# /usr/bin/env python3.6
# -*- encoding: utf-8 -*-
"""
@File    : ext.py
@Time    : 2020/2/2 0002 11:35
@Author  : zhangbing
@Email   : 18829172841@163.com
@Software: PyCharm
"""
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_session import Session
from flask_debugtoolbar import DebugToolbarExtension
from flask_bootstrap import Bootstrap
from flask_caching import Cache



db = SQLAlchemy()
migrate = Migrate()
toolbar = DebugToolbarExtension()
cache = Cache(
    config={
        "CACHE_TYPE": "redis",
    }
)


def create_ext(app):
    db.init_app(app)
    migrate.init_app(app, db)
    Session(app)
    toolbar.init_app(app)
    Bootstrap(app)
    cache.init_app(app)


if __name__ == "__main__":
    pass
